package com.yiren.dbaa.module.device.util;

import com.yiren.backstage.communication.utils.MessagesUtil;
import com.yiren.backstage.currency.constant.SignalGConstant;
import com.yiren.dbaa.constant.G;

import java.util.Map;

/**
 * Created by WANGRONGXIANG
 * on 2022/6/13
 * Describe 获取硬件更新路径工具类
 */
public class HardwareUpdatePathUtil {

    public static String getPackageObjectKey() {
        String hardwareUpgradesPath;
        if (G.connectDeviceMessage.getVersionDescribe().contains("XQ")) { //滴驾自研v4.0P主机盒
            hardwareUpgradesPath = G.isHardware ? "hd/DiJia-XQ/" : "hd/fenggongTest/";
        } else if (G.connectDeviceMessage.getVersionDescribe().contains("WP")) {
            hardwareUpgradesPath = G.isHardware ? "hd/DiJia-WP/" : "hd/fenggongTest/";
        } else if (G.connectDeviceMessage.getVersionDescribe().contains("YR")) {
            if (G.connectDeviceMessage.getVersionDescribe().contains("GDZ")) { //滴驾自研固定站
                hardwareUpgradesPath = G.isHardware ? "hd/DiJia-YR-GDZ/" : "hd/fenggongTest/";
            } else { //滴驾自研主机盒
                hardwareUpgradesPath = G.isHardware ? "hd/DiJia/" : "hd/fenggongTest/";
            }
        } else if (G.connectDeviceMessage.getVersionDescribe().contains("JX")) {
            //接线版
            hardwareUpgradesPath = G.isHardware ? "hd/newjxb/" : "hd/fenggongTest/";
        } else if (G.connectDeviceMessage.getVersionDescribe().contains("MP")) {
            if (G.connectDeviceMessage.getVersionDescribe().contains("MP2.0")) {
                //大班长2.0版本主机升级
                hardwareUpgradesPath = G.isHardware ? "hd/newmp2.0/" : "hd/fenggongTest/";
            } else if (G.connectDeviceMessage.getVersionDescribe().contains("MPQD")) {
                //七斗1.0版本主机
                hardwareUpgradesPath = G.isHardware ? "hd/newmpQD/" : "hd/fenggongTest/";
            } else if (G.connectDeviceMessage.getVersionDescribe().contains("MP7D")) {
                //七斗1.0版本主机
                hardwareUpgradesPath = G.isHardware ? "hd/newmp7D/" : "hd/fenggongTest/";
            } else {
                hardwareUpgradesPath = G.isHardware ? "hd/newmpb/" : "hd/fenggongTest/";
            }
        } else {
            hardwareUpgradesPath = G.isHardware ? "hd/new/" : "hd/fenggongTest/";
        }
        return hardwareUpgradesPath;
    }

    public static String getConfigObjectKey() {
        String hardwareUpgradesInstructions;
        if (G.connectDeviceMessage.getVersionDescribe().contains("XQ")) {
            hardwareUpgradesInstructions = G.isHardware ? "hd/DiJia-XQ/config.txt" : "hd/fenggongTest/config.txt";
        } else if (G.connectDeviceMessage.getVersionDescribe().contains("WP")) {
            hardwareUpgradesInstructions = G.isHardware ? "hd/DiJia-WP/config.txt" : "hd/fenggongTest/config.txt";
        } else if (G.connectDeviceMessage.getVersionDescribe().contains("YR")) {
            if (G.connectDeviceMessage.getVersionDescribe().contains("GDZ")) {
                hardwareUpgradesInstructions = G.isHardware ? "hd/DiJia-YR-GDZ/config.txt" : "hd/fenggongTest/config.txt";
            } else {
                hardwareUpgradesInstructions = G.isHardware ? "hd/DiJia/config.txt" : "hd/fenggongTest/config.txt";
            }
        } else if (G.connectDeviceMessage.getVersionDescribe().contains("JX")) {
            hardwareUpgradesInstructions = G.isHardware ? "hd/newjxb/config.txt" : "hd/fenggongTest/config.txt";
        } else if (G.connectDeviceMessage.getVersionDescribe().contains("MP")) {
            if (G.connectDeviceMessage.getVersionDescribe().contains("MP2.0")) {
                //大班长2.0版本主机升级
                hardwareUpgradesInstructions = G.isHardware ? "hd/newmp2.0/config.txt" : "hd/fenggongTest/config.txt";
            } else if (G.connectDeviceMessage.getVersionDescribe().contains("MPQD")) {
                //七斗1.0版本主机
                hardwareUpgradesInstructions = G.isHardware ? "hd/newmpQD/config.txt" : "hd/fenggongTest/config.txt";
            } else if (G.connectDeviceMessage.getVersionDescribe().contains("MP7D")) {
                //七斗1.0版本主机
                hardwareUpgradesInstructions = G.isHardware ? "hd/newmp7D/config.txt" : "hd/fenggongTest/config.txt";
            } else {
                hardwareUpgradesInstructions = G.isHardware ? "hd/newmpb/config.txt" : "hd/fenggongTest/config.txt";
            }
        } else {
            hardwareUpgradesInstructions = G.isHardware ? "hd/new/config.txt" : "hd/fenggongTest/config.txt";
        }
        return hardwareUpgradesInstructions;
    }
}
